package com.jilefojing.service;

import java.util.List;

import com.jilefojing.beans.enums.ItemTypeEnumForSource;
import com.jilefojing.beans.enums.PlatformEnum;
import com.jilefojing.beans.exception.UserContextException;
import com.jilefojing.beans.pojos.Recommend;
import com.jilefojing.beans.pojos.enhanced.EnhancedRecommend;
import com.jilefojing.beans.query.RecommendQuery;
import com.jilefojing.beans.vo.Pagination;
import com.jilefojing.beans.vo.UploadFile;
import com.jilefojing.context.beans.vo.UserContext;
import com.jilefojing.service.base.IBaseService;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月19日 17时57分48秒
 */
public interface IRecommendService extends IBaseService<Recommend> {
	Pagination<EnhancedRecommend> getPaginationForActive(PlatformEnum platform, ItemTypeEnumForSource itemType, Pagination<EnhancedRecommend> pagination, UserContext userContext);

	Pagination<EnhancedRecommend> getPagination(RecommendQuery recommendQuery, Pagination<EnhancedRecommend> pagination, UserContext userContext);

	List<EnhancedRecommend> conventRecommends2EnhancedRecommends(List<Recommend> recommends);

	List<EnhancedRecommend> appendEnhancedItems2EnhancedRecommends(List<EnhancedRecommend> enhancedRecommends, UserContext userContext);

	List<EnhancedRecommend> appendEnhancedUsers2EnhancedRecommends(List<EnhancedRecommend> enhancedRecommends, UserContext userContext);

	/**
	 * 只更新推荐信息以及排序
	 * 
	 * @param recommend
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	Recommend update(Recommend recommend, UserContext userContext) throws UserContextException;

	void deleteById(long id, UserContext userContext) throws UserContextException;

	void deleteByIds(List<Long> ids, UserContext userContext);

	Recommend add(Recommend recommend, UploadFile coverFile, UserContext userContext) throws UserContextException;

	List<EnhancedRecommend> getEnhancedRecommendsByItems(ItemTypeEnumForSource itemType, List<Long> itemIds, UserContext userContext);

}
